/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.miracleteam.miracle.utils;

import com.miracleteam.miracle.entities.Sanphamcotaicuahang;
import com.miracleteam.miracle.services.SanPhamCoTaiCuaHangService;
import com.miracleteam.miracle.services.servicesImpl.SanPhamCoTaiCuaHangServiceImpl;
import org.apache.tapestry5.ValueEncoder;

/**
 *
 * @author DangKhoa
 */
public class SanPhamCoTaiCuaHangEncoder implements ValueEncoder<Sanphamcotaicuahang> {
 

    public String toClient(Sanphamcotaicuahang v) {
        return v.getMaSanPhamCoTaiCuaHang();
    }

    public Sanphamcotaicuahang toValue(String string) {
        SanPhamCoTaiCuaHangService spServ=new SanPhamCoTaiCuaHangServiceImpl();
        return spServ.LaySPCoTaiCuaHang(string);
    }
    
    
}
